File Formats |
Though KeePass supports many more import/export formats, this document only details the
CSV and XML file formats. These formats aren't specialized password database formats
themselves, but almost
all other password manager applications can export their data in some form of
CSV and XML. Knowing the formats that KeePass expects when importing, you shouldn't
have any problems manually reformating the files in order to get accepted by KeePass.
Mostly you just have to rearrange the columns in CSV files for example (using a program
like OpenOffice.org's spreadsheet application).
Unfortunately there isn't any standard password database format. Every password
manager uses its own file format. Most users are a bit confused when application 1
exports data to a CSV file and application 2 cannot read the file though it claims it
can read CSV files. This is because CSV and XML aren't specialized and standardized password
database file formats, but just some form of data arrangement. Every program
can arrange the data in a different form, making the applications incompatible to each other.
Even worse, the files can be encoded in various forms (ANSI, Unicode, UTF-8, ...).
KeePass can import many file formats (for example: CSV, CodeWallet TXT, PwSafe v2 TXT,
Personal Vault TXT, AnyPassword CSV, PINs TXT, XML, and many more). The list of supported
import formats is increasing daily, have a look at the
KeePass plugins
page for import format plugins.
These import plugins are specialized on importing data from other password managers and you normally
don't need to manually reformat/reencode the files. Therefore first look if a plugin
exists for your password manager before experimenting with the CSV and XML formats.
If no import plugin exists for your password manager, feel free to post a request
in the
KeePass feature requests
forum and/or in the
open discussion forum.
Import/export: CSV |
KeePass imports and exports data from/to CSV files in the following format:
"Account","Login Name","Password","Web Site","Comments"
Example file:
"Account","Login Name","Password","Web Site","Comments"
"Password of \"MyBank\" account","Michael Sample","wefntzuseu46z","www.mybank.com","Credit Card No.: xxxx-xxxx-xxxx-xxxx"
"My Online-Forum","myusername","enkl45h","http://www.myonlineforum.net","multi-line comment
multi-line comment
multi-line comment"
Notes:
- The whole CSV file must be encoded in UTF-8 when importing. KeePass automatically encodes
the file in UTF-8 when exporting data to a CSV file. Other encodings aren't supported.
- CSV files only support title/user/password/URL/notes. Other fields like the last
entry modification time, expiration time, icon, entry file attachments, etc. aren't supported.
Use a different file format (like XML) if you need to transfer this information.
- The strings must be enclosed in quotes ("), unquoted strings aren't allowed.
- Quotes (") in strings are encoded as
\"
. Backslashes (\) are encoded as \\
.
Unencoded quotes are not supported and will lead to an importing error message!
- Multi-line comments and strings are realized through normal line-breaks. They are not encoded by \n or
something like this.
Import/export: XML |
A sample XML file:
<?xml version="1.0" encoding="UTF-8"?>
<pwlist>
<pwentry>
<group>General</group>
<title>I am expired " this was a quot</title>
<username>Peter Sample</username>
<url>http://www.google.com</url>
<password>The Password</password>
<notes>Some Notes</notes>
<uuid>3055035d87adbdd617c9fd810e18d788</uuid>
<image>2</image>
<creationtime>2005-03-25T17:17:44</creationtime>
<lastmodtime>2005-03-26T10:14:27</lastmodtime>
<lastaccesstime>2005-03-26T10:14:27</lastaccesstime>
<expiretime expires="true">2000-01-01T01:01:00</expiretime>
</pwentry>
<pwentry>
<group>Internet</group>
<title>I am expired</title>
<username>Anonymous</username>
<url>http://keepass.sourceforge.net</url>
<password>The Password</password>
<notes>Some Notes</notes>
<uuid>8239f06b53cf4f06d1b7ffaa04734288</uuid>
<image>0</image>
<creationtime>2005-03-25T17:17:44</creationtime>
<lastmodtime>2005-03-25T17:17:44</lastmodtime>
<lastaccesstime>2005-03-25T17:17:44</lastaccesstime>
<expiretime expires="true">2000-01-01T01:01:00</expiretime>
</pwentry>
</pwlist>
Notes:
- KeePass exports XML files in UTF-8 encoded form. When importing, the XML files
must encoded in UTF-8, too. Other encodings aren't supported.
- KeePass can export data to XML files directly. It can import data from XML
files through a
XML import plugin.
- The following five entities must be encoded:
< > & " '
. They are encoded
by < > & " '
.
- The UUID is a hex-encoded 16-byte string (i.e. an 32 ANSI hex character string in the XML file). The UUID
is unique and can be used to identify entries.
- Dates/times are encoded in the standard date/time XML format: first comes the date in
the form YYYY-MM-DD, a 'T' character follows (indicates that a time string follows), the
time follows in the form HH:mm:ss.